<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>订单管理</title>
	<jsp:include page="/pages/common/head.jsp"></jsp:include>

</head>
<script>
	$(function (){
		$("#sendOrder").click(function (){
			return confirm("你确定要发货?");
		})
	})
</script>

<style>
	#main .deleteClass{
		display: inline-block;
		padding: 0 5px;
		background-color: #f56c6c;
		transition: 0.1s;
		font-size: 17px;
		color: #fff;
		text-decoration: none;
		border-radius: 3px;
	}
	#main .deleteClass:hover{
		background-color: #f78989;
	}
</style>
<body>
	
	<div id="header">

			<span class="wel_word">订单管理</span>
			<%--静态包含manager管理模块的菜单--%>
			<%@include file="/pages/common/manager_menu.jsp"%>
	</div>
	
	<div id="main">
		<table>
			<tr>
				<td>订单号</td>
				<td>买家号</td>
				<td>日期</td>
				<td>金额</td>
				<td>详情</td>
				<td>发货</td>
				<td>操作</td>
			</tr>
			<c:forEach items="${requestScope.page.items}" var="order">
				<tr>
					<td>${order.orderId}</td>
					<td>${order.userId}</td>
					<td>${order.createTime.toString().substring(0,10)}</td>
					<td>${order.price}</td>
					<td><a href="orderServlet?action=showOrderDetail&orderId=${order.orderId}">查看详情</a></td>
					<c:if test="${order.status == 0}">
						<td><a id="sendOrder" href="orderServlet?action=sendOrder&orderId=${order.orderId}">点击发货</a></td>
					</c:if>
					<c:if test="${order.status == 1}">
						<td>已发货</td>
					</c:if>
					<c:if test="${order.status == 2}">
						<td>已收货</td>
					</c:if>
					<td><a class="deleteClass" href="orderServlet?action=delete&id=${order.orderId}">删除</a></td>
				</tr>
			</c:forEach>


		</table>

		<%--静态包含分页条--%>
		<%@include file="/pages/common/page_nav.jsp"%>
	</div>

	<%--静态包含页脚内容--%>
	<%@include file="/pages/common/foot.jsp"%>
</body>
</html>